package game.scenario;

import java.awt.Graphics2D;

import core.rendering.Sprite;

public class GraphicMapLayer {
	
	Sprite [][] layerData;
	
	public GraphicMapLayer(int layerData_[][] , MapTileset tileset){
		layerData = new Sprite[layerData_.length][layerData_[0].length];
		
		for (int cont = 0 ; cont < layerData_.length ; cont++){
			for (int cont2 = 0 ; cont2 < layerData_[cont].length ; cont2++){
				layerData[cont][cont2] = tileset.getTile(layerData_[cont][cont2]);
			}
		}
	}
	
	public void render(Graphics2D g2d){
		for (int cont = 0 ; cont < layerData.length ; cont++){
			for (int cont2 = 0 ; cont2 < layerData[cont].length ; cont2++){
				layerData[cont][cont2].render(g2d , cont *  layerData[cont][cont2].getWidth() , cont2 * layerData[cont][cont2].getHeight());
			}
		}
	}
}
